package com.frank.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.frank.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author Frank
 */
@Mapper
public interface UserMapper extends BaseMapper{
    User findUserByUP(User user);

    List<User> findAll();

    @Select("SELECT COUNT(1) FROM user" )
    long fandTotal();

    List<User> findUserList(@Param("start") int start, @Param("size") int size, @Param("query") String query);

    /**修改用户状态*/
    @Update("update user set status=#{status}," + "updated=#{updated} where id=#{id}")
    void updateStatus(User user);

    void DeleteById(Integer id);

    void addUser(User user);

    User findUserById(Integer id);

    void updateUser(User user);
}
